3.315 \(\int \frac {\frac {b B}{a}+B \tan (c+d x)}{a+b \tan (c+d x)} \, dx\)

Optimal. Leaf size=58 \[ \frac {2 b B x}{a^2+b^2}-\frac {B \left (a-\frac {b^2}{a}\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )} \]

[Out]

2*b*B*x/(a^2+b^2)-(a-b^2/a)*B*ln(a*cos(d*x+c)+b*sin(d*x+c))/(a^2+b^2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3531, 3530} \[ \frac {2 b B x}{a^2+b^2}-\frac {B \left (a-\frac {b^2}{a}\right ) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[((b*B)/a + B*Tan[c + d*x])/(a + b*Tan[c + d*x]),x]

[Out]

(2*b*B*x)/(a^2 + b^2) - ((a - b^2/a)*B*Log[a*Cos[c + d*x] + b*Sin[c + d*x]])/((a^2 + b^2)*d)

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rubi steps

\begin {align*} \int \frac {\frac {b B}{a}+B \tan (c+d x)}{a+b \tan (c+d x)} \, dx &=\frac {2 b B x}{a^2+b^2}-\frac {\left (\left (a-\frac {b^2}{a}\right ) B\right ) \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^2+b^2}\\ &=\frac {2 b B x}{a^2+b^2}-\frac {\left (a-\frac {b^2}{a}\right ) B \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right ) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.11, size = 65, normalized size = 1.12 \[ \frac {B \left (\left (a^2-b^2\right ) \left (\log \left (\sec ^2(c+d x)\right )-2 \log (a+b \tan (c+d x))\right )+4 a b \tan ^{-1}(\tan (c+d x))\right )}{2 a d \left (a^2+b^2\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[((b*B)/a + B*Tan[c + d*x])/(a + b*Tan[c + d*x]),x]

[Out]

(B*(4*a*b*ArcTan[Tan[c + d*x]] + (a^2 - b^2)*(Log[Sec[c + d*x]^2] - 2*Log[a + b*Tan[c + d*x]])))/(2*a*(a^2 + b
^2)*d)

________________________________________________________________________________________

fricas [A]  time = 0.59, size = 78, normalized size = 1.34 \[ \frac {4 \, B a b d x - {\left (B a^{2} - B b^{2}\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, {\left (a^{3} + a b^{2}\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*B/a+B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(4*B*a*b*d*x - (B*a^2 - B*b^2)*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)))/
((a^3 + a*b^2)*d)

________________________________________________________________________________________

giac [A]  time = 0.29, size = 99, normalized size = 1.71 \[ \frac {\frac {4 \, {\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac {{\left (B a^{2} - B b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{3} + a b^{2}} - \frac {2 \, {\left (B a^{2} b - B b^{3}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{3} b + a b^{3}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*B/a+B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/2*(4*(d*x + c)*B*b/(a^2 + b^2) + (B*a^2 - B*b^2)*log(tan(d*x + c)^2 + 1)/(a^3 + a*b^2) - 2*(B*a^2*b - B*b^3)
*log(abs(b*tan(d*x + c) + a))/(a^3*b + a*b^3))/d

________________________________________________________________________________________

maple [B]  time = 0.26, size = 142, normalized size = 2.45 \[ -\frac {B a \ln \left (a +b \tan \left (d x +c \right )\right )}{d \left (a^{2}+b^{2}\right )}+\frac {b^{2} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d a \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a B}{2 d \left (a^{2}+b^{2}\right )}-\frac {B \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) b^{2}}{2 d a \left (a^{2}+b^{2}\right )}+\frac {2 B \arctan \left (\tan \left (d x +c \right )\right ) b}{d \left (a^{2}+b^{2}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*B/a+B*tan(d*x+c))/(a+b*tan(d*x+c)),x)

[Out]

-1/d*B*a/(a^2+b^2)*ln(a+b*tan(d*x+c))+1/d*b^2/a/(a^2+b^2)*ln(a+b*tan(d*x+c))*B+1/2/d/(a^2+b^2)*ln(1+tan(d*x+c)
^2)*a*B-1/2/d*B/a/(a^2+b^2)*ln(1+tan(d*x+c)^2)*b^2+2/d/(a^2+b^2)*B*arctan(tan(d*x+c))*b

________________________________________________________________________________________

maxima [A]  time = 0.50, size = 95, normalized size = 1.64 \[ \frac {\frac {4 \, {\left (d x + c\right )} B b}{a^{2} + b^{2}} - \frac {2 \, {\left (B a^{2} - B b^{2}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{3} + a b^{2}} + \frac {{\left (B a^{2} - B b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{3} + a b^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*B/a+B*tan(d*x+c))/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(4*(d*x + c)*B*b/(a^2 + b^2) - 2*(B*a^2 - B*b^2)*log(b*tan(d*x + c) + a)/(a^3 + a*b^2) + (B*a^2 - B*b^2)*l
og(tan(d*x + c)^2 + 1)/(a^3 + a*b^2))/d

________________________________________________________________________________________

mupad [B]  time = 6.57, size = 112, normalized size = 1.93 \[ -\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (B\,b+B\,a\,1{}\mathrm {i}\right )}{2\,d\,\left (a\,b-a^2\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B\,a+B\,b\,1{}\mathrm {i}\right )}{2\,d\,\left (-a^2+a\,b\,1{}\mathrm {i}\right )}-\frac {B\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a^2-b^2\right )}{a\,d\,\left (a^2+b^2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*tan(c + d*x) + (B*b)/a)/(a + b*tan(c + d*x)),x)

[Out]

- (log(tan(c + d*x) - 1i)*(B*a*1i + B*b))/(2*d*(a*b - a^2*1i)) - (log(tan(c + d*x) + 1i)*(B*a + B*b*1i))/(2*d*
(a*b*1i - a^2)) - (B*log(a + b*tan(c + d*x))*(a^2 - b^2))/(a*d*(a^2 + b^2))

________________________________________________________________________________________

sympy [A]  time = 0.87, size = 235, normalized size = 4.05 \[ \begin {cases} \text {NaN} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {B}{b d \tan {\left (c + d x \right )} - i b d} & \text {for}\: a = - i b \\- \frac {B}{b d \tan {\left (c + d x \right )} + i b d} & \text {for}\: a = i b \\\frac {x \left (B \tan {\relax (c )} + \frac {B b}{a}\right )}{a + b \tan {\relax (c )}} & \text {for}\: d = 0 \\\frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a d} & \text {for}\: b = 0 \\- \frac {2 B a^{2} \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{3} d + 2 a b^{2} d} + \frac {B a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{3} d + 2 a b^{2} d} + \frac {4 B a b d x}{2 a^{3} d + 2 a b^{2} d} + \frac {2 B b^{2} \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{3} d + 2 a b^{2} d} - \frac {B b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{3} d + 2 a b^{2} d} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*B/a+B*tan(d*x+c))/(a+b*tan(d*x+c)),x)

[Out]

Piecewise((nan, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (-B/(b*d*tan(c + d*x) - I*b*d), Eq(a, -I*b)), (-B/(b*d*tan(c
+ d*x) + I*b*d), Eq(a, I*b)), (x*(B*tan(c) + B*b/a)/(a + b*tan(c)), Eq(d, 0)), (B*log(tan(c + d*x)**2 + 1)/(2*
a*d), Eq(b, 0)), (-2*B*a**2*log(a/b + tan(c + d*x))/(2*a**3*d + 2*a*b**2*d) + B*a**2*log(tan(c + d*x)**2 + 1)/
(2*a**3*d + 2*a*b**2*d) + 4*B*a*b*d*x/(2*a**3*d + 2*a*b**2*d) + 2*B*b**2*log(a/b + tan(c + d*x))/(2*a**3*d + 2
*a*b**2*d) - B*b**2*log(tan(c + d*x)**2 + 1)/(2*a**3*d + 2*a*b**2*d), True))

________________________________________________________________________________________